package com.neuedu.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neuedu.dao.DeviceDao;
import com.neuedu.model.Device;
import com.neuedu.service.DeviceService;

@Service
public class DeviceServiceImpl implements DeviceService {

	// 依赖注入
	@Autowired
	private DeviceDao DeviceDao;
	
	public void setDeviceDao(DeviceDao DeviceDao) {
		this.DeviceDao = DeviceDao;
	}
	
	@Override
	public int countDevice() {
		return DeviceDao.countDevice();
	}

	@Override
	public List<Device> findAll(Map<String, Object> map) {
		return DeviceDao.findAll(map);
	}

	@Override
	public int addDevice(Device u) {
		return DeviceDao.addDevice(u);
	}

	@Override
	public int updateDevice(Device u) {
		return DeviceDao.updateDevice(u);
	}

	@Override
	public int deleteDevice(int id) {
		return DeviceDao.deleteDevice(id);
	}

	@Override
	public Device findOne(int id) {
		// TODO Auto-generated method stub
		return DeviceDao.findOne(id);
	}

}